package ca.etsmtl.log720.lab1;
import java.lang.*;
import java.util.ArrayList;


public class DossierImpl extends DossierPOA {
	
	private int id;
	private String nom;
	private String noPermis;
	private String noPlaque;
	private String prenom;
	private int niveau;
	private int ListeInfraction[];
	private int ListeReaction[];
	private int currentInfraction =0;
	private int currentReaction =0;
	
	
	public DossierImpl(int id, String nom, String noPermis, String noPlaque, String prenom, int niveau)
	{
		this.id = id;
		this.nom = nom;
		this.noPermis = noPermis;
		this.noPlaque = noPlaque;
		this.prenom = prenom;
		this.niveau = niveau;
		ListeInfraction = new int[100];
		ListeReaction = new int[100];
		for(int i=0; i<100; i++){
			ListeInfraction[i] = -1;
			ListeReaction[i] = -1;
		}
	
	}
	
	public int id()
	{
	return id;
	}
	
	public String nom()
	{
	return nom;
	}
	
	public String noPermis()
	{
	return noPermis;
	}
	
	public String noPlaque()
	{
	return noPlaque;
	}
	
	public String prenom()
	{
	return prenom;
	}
	
	public int niveau()
	{
	return niveau;
	}
	
	public int[] getListeReaction()
	{
		return ListeReaction;
	}
	
	public int[] getListeInfraction()
	{
		return ListeInfraction;
	}
	
	public void ajouterReactionAListe(int idReaction)
	{
		ListeReaction[currentReaction] = idReaction;
		currentReaction++;
	}
	
	public void ajouterInfractionAListe(int idInfraction)
	{
		ListeInfraction[currentInfraction] = idInfraction;
		currentInfraction++;
	}
	
	//@Override
	public String _toString()
	{
	 return "Dossier id"+id +" " + nom +", " + prenom + "\npermis : " +noPermis +" plaque : "+ noPlaque +"\n niveau : " + niveau;
	}
	
	public void miseAJourNiveau(int newNiveau)
	{
		
			if(newNiveau > niveau)
				niveau = newNiveau;
	}
	
}